Skip to main content

Voting

Manages proposal voting.

Methods​

constructor​

constructor(address commAddr)

Initialization the community controller address.

communityVoteCast​

function communityVoteCast(uint256 commId, uint256 pollId, bool vote) external

Cast vote for the community poll.

Parameters​

NameTypeDescription
_0uint256undefined
_0uint256undefined
_0boolundefined

isAlreadyVoted​

function isAlreadyVoted(uint256 pollId) internal view returns(bool)

Check Voter already voted or not.

Parameters​

NameTypeDescription
_0uint256undefined

Returns​

NameTypeDescription
_0boolundefined

VotesInfo​

function VotesInfo(uint256 pollId) external

Function used to get the voting information of tha proposal.

Parameters​

NameTypeDescription
_0uint256undefined

pollFetch​

function pollFetch(uint256 id) internal returns ( CommunityPoll storage )

Get the details for the community poll (Proposal).

Parameters​

NameTypeDescription
_0uint256undefined

Returns​

NameTypeDescription
_0CommunityPollundefined

fetchPollData​

function fetchPollData(uint256 id) external view returns(CommunityPoll memory)

Get the poll details.

Parameters​

NameTypeDescription
_0uint256undefined

Returns​

NameTypeDescription
_0CommunityPollundefined

communityPollDelete​

function communityPollDelete(uint256 pollId) external 

Delete the community poll.

Parameters​

NameTypeDescription
_0uint256undefined

getPollVotes​

function getPollVotes(uint256 pollId) external view returns(uint256 agreed, uint256 reject) 

Get votes details.

Parameters​

NameTypeDescription
_0uint256undefined

Returns​

NameTypeDescription
_0uint256undefined
_1uint256undefined

_computePollResult​

function _computePollResult(uint256 communityId, uint256 pollId) internal returns(bool)

Compute poll result and return true or false.

Parameters​

NameTypeDescription
_0uint256undefined
_1uint256undefined

Returns​

NameTypeDescription
_0boolundefined

_doProposedChanges​

function _doProposedChanges(uint256 commId, uint256 pollId) external returns (bool)

It will do proposed changes in the community.

Parameters​

NameTypeDescription
_0uint256undefined
_1uint256undefined

Returns​

NameTypeDescription
_0boolundefined

Events​

EvtCommunityPollCreate​

event EvtCommunityPollCreate(uint256 pollId, uint256 startTimestamp, uint256 endTimestamp)

EvtCommunityPollDelete​

event EvtCommunityPollDelete(uint256 pollId)

EvtCommunityPollVotes​

event EvtCommunityPollVotes(uint256[] votesIds)

EvtCommunityPoll​

event EvtCommunityPoll(CommunityPoll poll)